home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / protocol / standard / scsi / scsi1_do.5 / text0000.txt < prev   
Encoding:
Text File  |  1993-07-14  |  67.5 KB  |  1,222 lines

  1.  
  2.  
  3. .fo Section 9                            #
  4. 9. Group 0 Command Descriptions for Sequential-Access Devices
  5.  
  6. The Group 0 commands for sequential-access devices shall be as shown in 
  7. Table9-1.
  8.  
  9.                                   Table 9-1
  10.                 Group 0 Commands for Sequential-Access Devices
  11.  
  12. ==============================================================================
  13. Operation
  14.   Code      Type   Command Name                       Section
  15. ------------------------------------------------------------------------------
  16.    00H       O     TEST UNIT READY                    7.1.1 
  17.    01H       M     REWIND                             9.1
  18.    02H       V
  19.    03H       M     REQUEST SENSE                      7.1.2
  20.    04H       R
  21.    05H       E     READ BLOCK LIMITS                  9.2
  22.    06H       V
  23.    07H       V
  24.    08H       M     READ                               9.3
  25.    09H       V
  26.    0AH       M     WRITE                              9.4
  27.    0BH       O     TRACK SELECT                       9.5
  28.    0CH       V
  29.    0DH       V
  30.    0EH       V
  31.    0FH       O     READ REVERSE                       9.6
  32.    10H       M     WRITE FILEMARKS                    9.7
  33.    11H       O     SPACE                              9.8
  34.    12H       E     INQUIRY                            7.1.3
  35.    13H       O     VERIFY                             9.9
  36.    14H       O     RECOVER BUFFERED DATA              9.10
  37.    15H       O     MODE SELECT                        9.11
  38.    16H       O     RESERVE UNIT                       9.12.1
  39.    17H       O     RELEASE UNIT                       9.12.2
  40.    18H       O     COPY                               7.1.4
  41.    19H       O     ERASE                              9.13
  42.    1AH       O     MODE SENSE                         9.14
  43.    1BH       O     LOAD/UNLOAD                        9.15
  44.    1CH       O     RECEIVE DIAGNOSTIC RESULTS         7.1.5
  45.    1DH       O     SEND DIAGNOSTIC                    7.1.6
  46.    1EH       O     PREVENT/ALLOW MEDIUM REMOVAL       9.16
  47.    1FH       R
  48. ==============================================================================
  49.  
  50. Key: M  =  Command implementation is mandatory.
  51.      E  =  Command implementation is required for SCSI devices that support 
  52.            device-independent self-configuring software.
  53.      O  =  Command implementation is optional.
  54.      R  =  Operation code is reserved for future standardization.
  55.      V  =  Operation code is available for vendor unique commands.
  56. .pa
  57.  
  58. 9.1 REWIND Command
  59.  
  60.      Peripheral Device Type:  Sequential Access
  61.         Operation Code Type:  Mandatory
  62.              Operation Code:  01H
  63.  
  64.                                   Table 9-2
  65.                                 REWIND Command
  66.  
  67. ==============================================================================
  68.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  69. Byte |        |        |        |        |        |        |        |        |
  70. ==============================================================================
  71.  0   |                           Operation Code                              |
  72. -----|-----------------------------------------------------------------------|
  73.  1   | Logical Unit Number      |                  Reserved         | Immed  |
  74. -----|-----------------------------------------------------------------------|
  75.  2   |                           Reserved                                    |
  76. -----|-----------------------------------------------------------------------|
  77.  3   |                           Reserved                                    |
  78. -----|-----------------------------------------------------------------------|
  79.  4   |                           Reserved                                    |
  80. -----|-----------------------------------------------------------------------|
  81.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  82. ==============================================================================
  83.  
  84.   The REWIND command (Table 9-2) requests that the target rewind the logical 
  85. unit to the beginning-of-medium or load-point.
  86.  
  87.   An immediate (Immed) bit of one indicates that status shall be returned as 
  88. soon as the operation is initiated.  An Immed bit of zero indicates that 
  89. status shall be returned after the operation is completed.
  90. .pa
  91.  
  92. 9.2 READ BLOCK LIMITS Command
  93.  
  94.      Peripheral Device Type:  Sequential Access
  95.         Operation Code Type:  Extended
  96.              Operation Code:  05H
  97.  
  98.                                   Table 9-3
  99.                           READ BLOCK LIMITS Command
  100.  
  101. ==============================================================================
  102.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  103. Byte |        |        |        |        |        |        |        |        |
  104. ==============================================================================
  105.  0   |                           Operation Code                              |
  106. -----|-----------------------------------------------------------------------|
  107.  1   | Logical Unit Number      |                  Reserved                  |
  108. -----|-----------------------------------------------------------------------|
  109.  2   |                           Reserved                                    |
  110. -----|-----------------------------------------------------------------------|
  111.  3   |                           Reserved                                    |
  112. -----|-----------------------------------------------------------------------|
  113.  4   |                           Reserved                                    |
  114. -----|-----------------------------------------------------------------------|
  115.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  116. ==============================================================================
  117.  
  118.   The READ BLOCK LIMITS command (Table 9-3) requests that the target's 
  119. capability for block length limits be returned for the logical unit.  The READ 
  120. BLOCK LIMITS data shown in Table 9-4 shall be sent during the DATA IN phase of 
  121. the command.
  122.  
  123.                                   Table 9-4
  124.                             READ BLOCK LIMITS Data
  125.  
  126. ==============================================================================
  127. Byte |                        Description                                    |
  128. ==============================================================================
  129.  0   |                           Reserved                                    |
  130. -----|-----------------------------------------------------------------------|
  131.  1   |                           Maximum Block Length (MSB)                  |
  132. -----|-----------------------------------------------------------------------|
  133.  2   |                           Maximum Block Length                        |
  134. -----|-----------------------------------------------------------------------|
  135.  3   |                           Maximum Block Length (LSB)                  |
  136. -----|-----------------------------------------------------------------------|
  137.  4   |                           Minimum Block Length (MSB)                  |
  138. -----|-----------------------------------------------------------------------|
  139.  5   |                           Minimum Block Length (LSB)                  |
  140. ==============================================================================
  141.  
  142.   If the maximum block length equals the minimum block length, only fixed-
  143. length blocks of the length indicated are supported.  Otherwise, variable-
  144. length blocks are supported.  For variable-length blocks, if the maximum block 
  145. length equals zero, no upper limit is specified.
  146. .pa
  147.  
  148. 9.3 READ Command
  149.  
  150.      Peripheral Device Type:  Sequential Access
  151.         Operation Code Type:  Mandatory
  152.              Operation Code:  08H
  153.  
  154.                                   Table 9-5
  155.                                  READ Command
  156.  
  157. ==============================================================================
  158.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  159. Byte |        |        |        |        |        |        |        |        |
  160. ==============================================================================
  161.  0   |                           Operation Code                              |
  162. -----|-----------------------------------------------------------------------|
  163.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  164. -----|-----------------------------------------------------------------------|
  165.  2   |                           Transfer Length (MSB)                       |
  166. -----|-----------------------------------------------------------------------|
  167.  3   |                           Transfer Length                             |
  168. -----|-----------------------------------------------------------------------|
  169.  4   |                           Transfer Length (LSB)                       |
  170. -----|-----------------------------------------------------------------------|
  171.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  172. ==============================================================================
  173.  
  174.   The READ command (Table 9-5) transfers one or more block(s) to the initiator 
  175. beginning with the next block on the logical unit.  The fixed bit specifies 
  176. both the meaning of the transfer length field and whether fixed-length or 
  177. variable-length block(s) are to be transferred.
  178.  
  179.   If the fixed bit is zero, a single block shall be transferred with the 
  180. transfer length specifying the maximum number of bytes the initiator has 
  181. allocated for the returned data.  If the actual block length is different from 
  182. the specified transfer length, a CHECK CONDITION status shall be sent to the 
  183. initiator and the incorrect length indicator (ILI) bit and valid bit in 
  184. extended sense shall be set to one.  The information bytes in extended sense 
  185. shall be set to the difference (residue) between the requested transfer length 
  186. and the actual block length.  Targets that do not support negative residues 
  187. shall set the ILI bit to one and the residue to zero when the actual block 
  188. length is larger than the transfer length.  In any case, no more than transfer 
  189. length bytes shall be transferred to the initiator and the medium shall be 
  190. positioned after the block (end-of-medium side).
  191.  
  192.   If the fixed bit is one, the transfer length specifies the number of blocks 
  193. to be transferred to the initiator.  This form of the READ command is valid 
  194. only if the logical unit is currently operating in fixed block mode.  A 
  195. logical unit is in fixed block mode when either of the following conditions 
  196. are true:
  197.  
  198.   (1) The logical unit reports the same value for minimum block length and 
  199. maximum block length in response to the READ BLOCK LIMITS command.  In this 
  200. case, the current block length is the value returned.
  201.  
  202.   (2) The logical unit unit has been instructed to use fixed-length blocks 
  203. with the MODE SELECT command.  In this case, the current block length is the 
  204.  
  205. block length defined in the MODE SELECT command.
  206.  
  207.   Otherwise, the logical unit is in variable block mode.  The target may 
  208. implement fixed block mode, variable block mode, or both modes.  If the fixed 
  209. bit does not match the current mode, or the mode indicated by the fixed bit is 
  210. not implemented, the target shall reject the command by returning a CHECK 
  211. CONDITION status and by setting the sense key to ILLEGAL REQUEST.
  212.  
  213.   A successful READ command with the fixed bit equal to one shall transfer the 
  214. current block length times the transfer length bytes of data to the initiator.  
  215. Upon termination of the READ command, the medium shall be positioned after the 
  216. last block transferred (end-of-medium side).
  217.  
  218.   If the fixed bit is one and if a block is read that is larger or smaller 
  219. than the current block length, a CHECK CONDITION status shall be returned to 
  220. the initiator.  The ILI bit and the valid bit in extended sense shall be set 
  221. to one.  The information bytes shall be set to the difference (residue) 
  222. between the requested transfer length and the actual number of blocks read 
  223. (not including the incorrect length block).  Upon termination, the medium 
  224. shall be positioned after the incorrect length block (end-of-medium side). 
  225.  
  226.   If a logical unit reads a filemark during a READ command, it shall send a 
  227. CHECK CONDITION status to the initiator and shall set the filemark bit in 
  228. extended sense.  Upon termination, the medium shall be positioned after the 
  229. filemark (end-of-medium side).  If the fixed bit is one, the target shall set 
  230. the valid bit to one and the information bytes shall be set to the difference 
  231. (residue) between the requested transfer length and the actual number of 
  232. blocks read (not including the filemark).
  233.  
  234.   If a logical unit encounters the physical end-of-medium during a READ 
  235. command, the target shall return a CHECK CONDITION status to the initiator and 
  236. shall set the end-of-medium (EOM) bit to one in extended sense.  The sense key 
  237. shall be set to MEDIUM ERROR.  If the fixed bit is one, the target shall set 
  238. the valid bit to one and the information bytes to the difference (residue) 
  239. between the requested transfer length and the actual number of blocks 
  240. successfully read.  The medium position following this condition is not 
  241. defined. 
  242.  
  243.   When the transfer length is zero, no data shall be transferred and the 
  244. current position on the logical unit shall not be changed.  This condition 
  245. shall not be considered as an error. 
  246. .pa
  247.  
  248. 9.4 WRITE Command
  249.  
  250.      Peripheral Device Type:  Sequential Access
  251.         Operation Code Type:  Mandatory
  252.              Operation Code:  0AH
  253.  
  254.                                   Table 9-6
  255.                                 WRITE Command
  256.  
  257. ==============================================================================
  258.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  259. Byte |        |        |        |        |        |        |        |        |
  260. ==============================================================================
  261.  0   |                           Operation Code                              |
  262. -----|-----------------------------------------------------------------------|
  263.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  264. -----|-----------------------------------------------------------------------|
  265.  2   |                           Transfer Length (MSB)                       |
  266. -----|-----------------------------------------------------------------------|
  267.  3   |                           Transfer Length                             |
  268. -----|-----------------------------------------------------------------------|
  269.  4   |                           Transfer Length (LSB)                       |
  270. -----|-----------------------------------------------------------------------|
  271.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  272. ==============================================================================
  273.  
  274.   The WRITE command (Table 9-6) transfers one or more block(s) from the 
  275. initiator to the current position on the logical unit.  The fixed bit 
  276. specifies both the meaning of the transfer length field and whether fixed-
  277. length or variable-length block(s) are to be transferred.
  278.  
  279.   If the fixed bit is zero, a single block shall be transferred from the 
  280. initiator and shall be written to the logical unit beginning at the current 
  281. medium position.  The transfer length specifies the length of the block to be 
  282. written (in bytes).  The requested block length shall be within the minimum 
  283. and maximum block length range (returned by the READ BLOCK LIMITS command, 
  284. Section 9.2).  If this condition is not met, a CHECK CONDITION status  shall 
  285. be returned and the sense key shall be set to ILLEGAL REQUEST and no data 
  286. shall be written.  Upon successful termination, the medium shall be positioned 
  287. after the block written by this command (end-of-medium side).
  288.  
  289.   If the fixed bit is one, the transfer length field specifies the number of 
  290. block(s) to be transferred to the logical unit beginning at the current medium 
  291. position.  This form of the WRITE command is valid only if the logical unit is 
  292. currently operating in fixed block mode (see 9.3).  Upon termination, the 
  293. medium shall be positioned after the block(s) written by this command (end-of-
  294. medium side)
  295.  
  296.   The target may implement fixed block mode, variable block mode, or both 
  297. modes.  If the fixed bit does not match the current mode, or the mode 
  298. indicated by the fixed bit is not implemented, the target shall reject the 
  299. command by returning a CHECK CONDITION status and by setting the sense key to 
  300. ILLEGAL REQUEST.
  301.  
  302.   If the early warning end-of-medium condition is encountered while writing, 
  303. an attempt to finish writing any buffered data may be made.  The command shall 
  304.  
  305. terminate with a CHECK CONDITION status and the EOM bit in extended sense 
  306. shall be set to one.  If any data remains in the target's buffer, then the 
  307. sense key shall be set to VOLUME OVERFLOW.  If the fixed bit is one and the 
  308. logical unit is not buffered (buffered mode of the MODE SENSE command is 
  309. zero), then the valid bit in extended sense shall be set to one and the 
  310. information bytes shall be set to the difference (residue) between the 
  311. requested transfer length and the actual number of blocks written to the 
  312. medium.  If the fixed bit is one and the logical unit is buffered (buffered 
  313. mode of the MODE SENSE command is one), then the valid bit shall be set to one 
  314. and the information bytes shall be set to the total number of blocks not 
  315. written (the number of blocks not transferred from the initiator plus the 
  316. number of blocks remaining in the target's buffer).  Note that in this case it 
  317. is possible for the value in the information bytes to exceed the transfer 
  318. length.
  319.  
  320.   When the transfer length is zero, no data shall be transferred and the 
  321. current position on the logical unit shall not be changed.  This condition 
  322. shall not be considered as an error.
  323.  
  324. 9.5 TRACK SELECT Command
  325.  
  326.      Peripheral Device Type:  Sequential Access
  327.         Operation Code Type:  Optional
  328.              Operation Code:  0BH
  329.  
  330.                                   Table 9-7
  331.                              TRACK SELECT Command
  332.  
  333. ==============================================================================
  334.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  335. Byte |        |        |        |        |        |        |        |        |
  336. ==============================================================================
  337.  0   |                           Operation Code                              |
  338. -----|-----------------------------------------------------------------------|
  339.  1   | Logical Unit Number      |                  Reserved                  |
  340. -----|-----------------------------------------------------------------------|
  341.  2   |                           Reserved                                    |
  342. -----|-----------------------------------------------------------------------|
  343.  3   |                           Reserved                                    |
  344. -----|-----------------------------------------------------------------------|
  345.  4   |                           Track Value                                 |
  346. -----|-----------------------------------------------------------------------|
  347.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  348. ==============================================================================
  349.  
  350.   The TRACK SELECT command (Table 9-7) requests that the track specified in 
  351. the track value field be selected.
  352. .pa
  353.  
  354. 9.6 READ REVERSE Command
  355.  
  356.      Peripheral Device Type:  Sequential Access
  357.         Operation Code Type:  Optional
  358.              Operation Code:  0FH
  359.  
  360.                                   Table 9-8
  361.                              READ REVERSE Command
  362.  
  363. ==============================================================================
  364.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  365. Byte |        |        |        |        |        |        |        |        |
  366. ==============================================================================
  367.  0   |                           Operation Code                              |
  368. -----|-----------------------------------------------------------------------|
  369.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  370. -----|-----------------------------------------------------------------------|
  371.  2   |                           Transfer Length (MSB)                       |
  372. -----|-----------------------------------------------------------------------|
  373.  3   |                           Transfer Length                             |
  374. -----|-----------------------------------------------------------------------|
  375.  4   |                           Transfer Length (LSB)                       |
  376. -----|-----------------------------------------------------------------------|
  377.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  378. ==============================================================================
  379.  
  380.   The READ REVERSE command (Table 9-8) functions identically to the READ 
  381. command except that medium motion is in the reverse direction.  Thus, the 
  382. block(s) and bytes within the block(s) are transferred in the reverse order 
  383. and the medium position upon termination is before the last block read 
  384. (beginning-of-medium side).  This command shall terminate with a CHECK 
  385. CONDITION status and the EOM bit in extended sense shall be set to one if 
  386. beginning-of-medium or load-point is encountered.  The sense key shall be set 
  387. to NO SENSE.  If the fixed bit is one, then the valid bit shall be set to one 
  388. and the information bytes shall contain the difference (residue) of the 
  389. requested transfer length and the actual number of blocks transferred before 
  390. beginning-of-medium or load-point was encountered.
  391.  
  392.   Filemark handling is the same as in the READ command except that the medium 
  393. position upon command termination shall be before the filemark (beginning-of-
  394. medium side).
  395.  
  396.   If the transfer length is zero, no data shall be transferred and the current 
  397. position on the logical unit shall not be changed.  This condition shall not 
  398. be considered as an error.
  399.  
  400.   The target may implement fixed block mode, variable block mode, or both 
  401. modes.  If the fixed bit does not match the current mode, or the mode 
  402. indicated by the fixed bit is not implemented, the target shall reject the 
  403. command by returning a CHECK CONDITION status and by setting the sense key to 
  404. ILLEGAL REQUEST.
  405. .pa
  406.  
  407. 9.7 WRITE FILEMARKS Command
  408.  
  409.      Peripheral Device Type:  Sequential Access
  410.         Operation Code Type:  Mandatory
  411.              Operation Code:  10H
  412.  
  413.                                   Table 9-9
  414.                            WRITE FILEMARKS Command
  415.  
  416. ==============================================================================
  417.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  418. Byte |        |        |        |        |        |        |        |        |
  419. ==============================================================================
  420.  0   |                           Operation Code                              |
  421. -----|-----------------------------------------------------------------------|
  422.  1   | Logical Unit Number      |                  Reserved                  |
  423. -----|-----------------------------------------------------------------------|
  424.  2   |                           Number of Filemarks (MSB)                   |
  425. -----|-----------------------------------------------------------------------|
  426.  3   |                           Number of Filemarks                         |
  427. -----|-----------------------------------------------------------------------|
  428.  4   |                           Number of Filemarks (LSB)                   |
  429. -----|-----------------------------------------------------------------------|
  430.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  431. ==============================================================================
  432.  
  433.   The WRITE FILEMARKS command (Table 9-9) causes the specified number of 
  434. filemarks to be written beginning at the current medium position on the 
  435. logical unit.  A zero in this field indicates that no filemarks are to be 
  436. written.
  437.  
  438.   This command is also used to force any buffered data (see buffered mode in 
  439. the MODE SENSE command, Section 9.14) to be written.  This command shall not 
  440. return a GOOD status unless all buffered data blocks and the filemarks (if 
  441. any) are correctly written on the medium.
  442.  
  443.   If the early warning end-of-medium condition is encountered while writing, 
  444. an attempt to finish writing any buffered data may be made.  The command shall 
  445. terminate with a CHECK CONDITION status and the EOM bit in extended sense 
  446. shall be set to one.  If any filemarks remain to be written, then the sense 
  447. key shall be set to VOLUME OVERFLOW.  If the logical unit is not buffered 
  448. (buffered mode of the MODE SENSE command is zero), then the valid bit in 
  449. extended sense shall be set to one and the information bytes shall be set to 
  450. the number of unwritten filemarks.  If the logical unit is buffered (buffered 
  451. mode of the MODE SENSE command is one), then the valid bit shall be set to one 
  452. and the information bytes shall be set to the total number of blocks not 
  453. written (the number of unwritten filemarks plus the number of blocks remaining 
  454. in the target's buffer).  Note that in this case it is possible for the value 
  455. in the information bytes to exceed the transfer length.
  456. .pa
  457.  
  458. 9.8 SPACE Command
  459.  
  460.      Peripheral Device Type:  Sequential Access
  461.         Operation Code Type:  Optional
  462.              Operation Code:  11H
  463.  
  464.                                   Table 9-10
  465.                                 SPACE Command
  466.  
  467. ==============================================================================
  468.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  469. Byte |        |        |        |        |        |        |        |        |
  470. ==============================================================================
  471.  0   |                           Operation Code                              |
  472. -----|-----------------------------------------------------------------------|
  473.  1   | Logical Unit Number      |         Reserved         |      Code       |
  474. -----|-----------------------------------------------------------------------|
  475.  2   |                           Count (MSB)                                 |
  476. -----|-----------------------------------------------------------------------|
  477.  3   |                           Count                                       |
  478. -----|-----------------------------------------------------------------------|
  479.  4   |                           Count (LSB)                                 |
  480. -----|-----------------------------------------------------------------------|
  481.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  482. ==============================================================================
  483.  
  484.   The SPACE command (Table 9-10) provides a variety of positioning functions 
  485. that are determined by the code and count.  Both forward (toward end-of-
  486. medium) and reverse (toward beginning-of-medium) positioning are provided, 
  487. although some SCSI devices may only support a subset of this command.  Such 
  488. SCSI devices shall return a CHECK CONDITION status and set the sense key to 
  489. ILLEGAL REQUEST in response to any attempt to invoke a function that is not 
  490. supported.
  491.  
  492.   The code is defined as follows:
  493.  
  494. DB(1)  DB(0)       Description
  495. -----  -----   --------------------
  496.   0      0     Blocks
  497.   0      1     Filemarks
  498.   1      0     Sequential Filemarks
  499.   1      1     Physical End-of-Data
  500.  
  501.   When spacing over blocks or filemarks, the count field specifies the number 
  502. of blocks or filemarks to be spaced over.  A positive value N in the count 
  503. field shall cause forward medium movement over N blocks or filemarks ending on 
  504. the end-of-medium side of the last block or filemark.  A zero value in the 
  505. count field shall cause no medium movement.  A negative value -N (2's 
  506. complement notation) in the count field shall cause reverse medium movement 
  507. over N blocks or filemarks ending on the beginning-of-medium side of the last 
  508. block or filemark.
  509.  
  510.   If a filemark is encountered while spacing over blocks, medium movement 
  511. shall be stopped.  The medium shall be positioned on the end-of-medium side of 
  512. the filemark if movement was in the forward direction and on the beginning-of-
  513. medium side of the filemark if movement was in the reverse direction.  A CHECK 
  514.  
  515. CONDITION status shall be sent to the initiator and the filemark and valid 
  516. bits in extended sense shall be set to one.  The information bytes shall be 
  517. set to the difference (residue) in the requested count and the actual number 
  518. of blocks spaced over (not including the filemark).
  519.  
  520.   If the physical end-of-medium is encountered while spacing forward over 
  521. blocks or filemarks, the target shall return a CHECK CONDITION status to the 
  522. initiator and shall set the end-of-medium (EOM) bit in extended sense to one.  
  523. The sense key shall be set to MEDIUM ERROR.  The target shall set the valid 
  524. bit to one and the information bytes to the difference (residue) between the 
  525. requested count and the actual number of blocks or filemarks spaced over.
  526.  
  527.   If beginning-of-medium or load-point is encountered while spacing over 
  528. blocks or filemarks in the reverse direction, the target shall return a CHECK 
  529. CONDITION status to the initiator and shall set the end-of-medium (EOM) bit in 
  530. extended sense to one.  The sense key shall be set to NO SENSE.  The target 
  531. shall set the valid bit to one and the information bytes to the difference 
  532. (residue) between the requested count and the actual number of blocks or 
  533. filemarks spaced over.
  534.  
  535.   When spacing over sequential filemarks, the count field is interpreted as 
  536. follows:
  537.  
  538.   (1) A positive value N shall cause forward medium movement to the first 
  539. occurrence of N or more consecutive filemarks stopping after the Nth filemark.
  540.  
  541.   (2) A zero value shall cause no medium movement.
  542.  
  543.   (3) A negative value -N (2's complement notation) shall cause reverse medium 
  544. movement to the first occurrence of N or more consecutive filemarks stopping 
  545. on the beginning-of-medium side of the Nth filemark.
  546.  
  547.   When spacing to physical end-of-data, the count field is ignored.  Forward 
  548. medium movement shall occur until the logical unit encounters physical end-of-
  549. data as defined by the sequential-access device.  Some sequential-access 
  550. devices  define physical end-of-data as an erased area on the medium; however, 
  551. other definitions are not precluded.  Targets that implement this function 
  552. shall leave the medium positioned such that a subsequent WRITE command would 
  553. append data to the last recorded information on the medium.
  554. .pa
  555.  
  556. 9.9 VERIFY Command
  557.  
  558.      Peripheral Device Type:  Sequential Access
  559.         Operation Code Type:  Optional
  560.              Operation Code:  13H
  561.  
  562.                                   Table 9-11
  563.                                 VERIFY Command
  564.  
  565. ==============================================================================
  566.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  567. Byte |        |        |        |        |        |        |        |        |
  568. ==============================================================================
  569.  0   |                           Operation Code                              |
  570. -----|-----------------------------------------------------------------------|
  571.  1   | Logical Unit Number      |         Reserved         | BytCmp | Fixed  |
  572. -----|-----------------------------------------------------------------------|
  573.  2   |                           Verification Length (MSB)                   | 
  574. -----|-----------------------------------------------------------------------|
  575.  3   |                           Verification Length                         |
  576. -----|-----------------------------------------------------------------------|
  577.  4   |                           Verification Length (LSB)                   | 
  578. -----|-----------------------------------------------------------------------|
  579.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  580. ==============================================================================
  581.  
  582.   The VERIFY command (Table 9-11) verifies one or more block(s) beginning with 
  583. the next block on the logical unit.  The fixed bit specifies both the meaning 
  584. of the verification length field and whether fixed-length or variable-length 
  585. block(s) are to be verified.
  586.  
  587.   A byte compare (BytCmp) bit of zero indicates that the verification shall be 
  588. simply a medium verification (CRC, ECC, etc).  No data shall be transferred 
  589. between the initiator and target.  A byte compare bit of one indicates that a 
  590. byte-by-byte compare of the data on the medium, and the data transferred from 
  591. the initiator shall be performed by the target.  Data shall be transferred 
  592. >From the initiator to the target as in a WRITE command.
  593.  
  594.   A fixed bit of zero requests that the next block of the logical unit be 
  595. verified.  The verification length specifies the number of bytes to verify.  A 
  596. fixed bit of one requests verification length blocks be verified beginning 
  597. with the next logical block on the logical unit.  This form of the VERIFY 
  598. command is only valid if the logical unit is currently in fixed block mode as 
  599. defined in the READ command.  If the data does not compare (byte compare bit 
  600. equals one), the command shall terminate with a CHECK CONDITION status and the 
  601. sense key shall be set to MISCOMPARE.  If the fixed bit is one, the valid bit 
  602. shall be set to one and the information bytes shall be set to the difference 
  603. (residue) between the verification length and the actual number of blocks 
  604. successfully verified.  The medium shall be positioned after the block 
  605. containing the miscompare (end-of-medium side).
  606.  
  607.   The target may implement fixed block mode, variable block mode, or both 
  608. modes.  If the fixed bit does not match the current mode, or the mode 
  609. indicated by the fixed bit is not implemented, the target shall reject the 
  610. command by returning a CHECK CONDITION status and by setting the sense key to 
  611. ILLEGAL REQUEST.
  612.  
  613.  
  614.   The VERIFY command shall terminate when the verification length has been 
  615. satisfied, when a filemark is encountered, or when physical end-of-medium is 
  616. encountered.  The status and sense data for each of these conditions are 
  617. handled the same as in the READ command.  Upon completion of the VERIFY 
  618. command, the medium shall be positioned after the last block from which data 
  619. was verified or after the filemark, if encountered. 
  620.  
  621.   When the verification length is zero, no data shall be verified and the 
  622. current position on the logical unit shall not be changed.  This condition 
  623. shall not be considered as an error.
  624.  
  625. 9.10 RECOVER BUFFERED DATA Command
  626.  
  627.      Peripheral Device Type:  Sequential Access
  628.         Operation Code Type:  Optional
  629.              Operation Code:  14H
  630.  
  631.                                   Table 9-12
  632.                         RECOVER BUFFERED DATA Command
  633.  
  634. ==============================================================================
  635.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  636. Byte |        |        |        |        |        |        |        |        |
  637. ==============================================================================
  638.  0   |                           Operation Code                              |
  639. -----|-----------------------------------------------------------------------|
  640.  1   | Logical Unit Number      |                  Reserved         | Fixed  |
  641. -----|-----------------------------------------------------------------------|
  642.  2   |                           Transfer Length (MSB)                       |
  643. -----|-----------------------------------------------------------------------|
  644.  3   |                           Transfer Length                             |
  645. -----|-----------------------------------------------------------------------|
  646.  4   |                           Transfer Length (LSB)                       |
  647. -----|-----------------------------------------------------------------------|
  648.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  649. ==============================================================================
  650.  
  651.   The RECOVER BUFFERED DATA command (Table 9-12) is used to read data that has 
  652. been transferred to an SCSI device buffer but has not been written on the 
  653. medium.  It is normally only used to recover from error or exception 
  654. conditions that make it impossible to write the buffered data on the medium.
  655.  
  656.   This command functions similarly to the READ command except that the data is 
  657. transferred from the SCSI device buffer instead of the medium.  The order in 
  658. which block(s) are transferred is the same as if they would have been 
  659. transferred to the medium.  One or more RECOVER BUFFERED DATA commands may be 
  660. used to read the unwritten buffered data.
  661.  
  662.   The target may implement fixed block mode, variable block mode, or both 
  663. modes.  If the fixed bit does not match the current mode, or the mode 
  664. indicated by the fixed bit is not implemented, the target shall reject the 
  665. command by returning a CHECK CONDITION status and by setting the sense key to 
  666. ILLEGAL REQUEST.
  667.  
  668.   If an attempt is made to recover more logical blocks of data than are 
  669.  
  670. contained in the SCSI device buffer, the command shall be terminated with a 
  671. CHECK CONDITION status.  The EOM bit in extended sense shall be set to one.  
  672. If the fixed bit is one, the valid bit shall be set to one and the information 
  673. bytes shall be set to the difference (residue) between the requested transfer 
  674. length and the actual number of blocks transferred.
  675.  
  676.   The transfer length specifies the number of contiguous logical blocks of 
  677. data to be transferred.  A transfer length of zero indicates that no data 
  678. shall be transferred.  This condition shall not be considered as an error.
  679.  
  680. 9.11 MODE SELECT Command
  681.  
  682.      Peripheral Device Type:  Sequential Access
  683.         Operation Code Type:  Optional
  684.              Operation Code:  15H
  685.  
  686.                                   Table 9-13
  687.                              MODE SELECT Command
  688.  
  689. ==============================================================================
  690.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  691. Byte |        |        |        |        |        |        |        |        |
  692. ==============================================================================
  693.  0   |                           Operation Code                              |
  694. -----|-----------------------------------------------------------------------|
  695.  1   | Logical Unit Number      |                  Reserved                  |
  696. -----|-----------------------------------------------------------------------|
  697.  2   |                           Reserved                                    |
  698. -----|-----------------------------------------------------------------------|
  699.  3   |                           Reserved                                    |
  700. -----|-----------------------------------------------------------------------|
  701.  4   |                           Parameter List Length                       |
  702. -----|-----------------------------------------------------------------------|
  703.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  704. ==============================================================================
  705.  
  706.   The MODE SELECT command (Table 9-13) provides a means for the initiator to 
  707. specify medium, logical unit, or peripheral device parameters to the target.
  708.  
  709.   The  parameter list length specifies the length in bytes of the MODE SELECT 
  710. parameter list that shall be transferred during the DATA OUT phase.  A zero 
  711. parameter list length indicates that no data shall be transferred.  This 
  712. condition shall not be considered as an error.
  713.  
  714.   The MODE SELECT parameter list shown in Table 9-14 contains a four-byte 
  715. header, followed by zero or more eight-byte block descriptors, followed by the 
  716. vendor unique parameters, if any.
  717. .pa
  718.  
  719.                                   Table 9-14
  720.                           MODE SELECT Parameter List
  721.  
  722. ==============================================================================
  723.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  724. Byte |        |        |        |        |        |        |        |        |
  725. ==============================================================================
  726.  0   |                           Reserved                                    |
  727. -----|-----------------------------------------------------------------------|
  728.  1   |                           Reserved                                    |
  729. -----|-----------------------------------------------------------------------|
  730.  2   |Reserved|      Buffered Mode       |          Speed                    |
  731. -----|-----------------------------------------------------------------------|
  732.  3   |                           Block Descriptor Length                     |
  733. ============================================================================== 
  734.      |                        Block Descriptor(s)                            |
  735. ==============================================================================
  736.  0   |                           Density Code                                |
  737. -----|-----------------------------------------------------------------------|
  738.  1   |                           Number of Blocks (MSB)                      |
  739. -----|-----------------------------------------------------------------------|
  740.  2   |                           Number of Blocks                            |
  741. -----|-----------------------------------------------------------------------|
  742.  3   |                           Number of Blocks (LSB)                      |
  743. -----|-----------------------------------------------------------------------|
  744.  4   |                           Reserved                                    |
  745. -----|-----------------------------------------------------------------------|
  746.  5   |                           Block Length (MSB)                          |
  747. -----|-----------------------------------------------------------------------|
  748.  6   |                           Block Length                                |
  749. -----|-----------------------------------------------------------------------|
  750.  7   |                           Block Length (LSB)                          |
  751. ==============================================================================
  752.      |                        Vendor Unique Parameter(s)                     |
  753. ==============================================================================
  754. 0 _ n|                           Vendor Unique                               |
  755.      |                           Parameter Byte(s)                           |
  756. ==============================================================================
  757.  
  758.   A buffered mode of zero indicates that the target shall not report a GOOD 
  759. status on WRITE commands until the data blocks are actually written on the 
  760. medium.  A buffered mode of one indicates that the target may report a GOOD 
  761. status on WRITE commands as soon as the data block has been transferred to the 
  762. SCSI device buffer.  One or more blocks may be buffered prior to writing the 
  763. block(s) to the medium.  Buffered modes of 2H through 7H are reserved.
  764.  
  765.   Code values for the speed field shall be assigned as follows:
  766.  
  767.    0H         Default (Use the  peripheral device's default speed).
  768.    1H         Use the peripheral device's lowest speed.
  769.    2H _ FH    Use increasing peripheral device speeds.
  770.  
  771.   The block descriptor length specifies the length in bytes of all the block 
  772. descriptors.  It is equal to the number of block descriptors times eight and 
  773. does not include the vendor unique parameters, if any.  A block descriptor 
  774. length of zero indicates that no block descriptors are included in the 
  775.  
  776. parameter list.  This condition shall not be considered as an error.
  777.  
  778.   Each block descriptor specifies the medium characteristics for all or part 
  779. of a logical unit.  Each block descriptor contains a density code, a number of 
  780. blocks, and a block length.
  781.  
  782.   Code values for the density code field are defined in Table 9-14.1.
  783.  
  784.                                  Table 9-14.1
  785.                        Sequential-access Density Codes
  786.  
  787. ==============================================================================
  788. Code Value                             Density
  789. ----------  ------------------------------------------------------------------
  790.    00H      Default (peripheral device's default or only density)
  791.        
  792.                                     Magnetic Tapes
  793.             Width                  Density                 Reference
  794.             mm. (Inch)   Tracks  BPMM   (BPI)  Code  Type  Standard      Note
  795.             ----------   ------  ------------  ----  ----  ------------  ----
  796.    01H      12.7 (0.5)      9     32    (800)  NRZI   R    X3.22-1983      3
  797.    02H      12.7 (0.5)      9     63  (1 600)  PE     R    X3.39-1973      3
  798.    03H      12.7 (0.5)      9    246  (6 250)  GCR    R    X3.54-1976      3
  799.    04H       6.3 (0.25)    4/9   315  (8 000)  GCR    C                  2,4
  800.    05H       6.3 (0.25)    4/9   315  (8 000)  GCR    C    X3.136-198X     2
  801.    06H      12.7 (0.5)      9    126  (3 200)  PE     R    X3B5/85-98    1,3
  802.    07H       6.3 (0.25)     4    252  (6 400)  IMFM   C    X3.116-198X     2
  803.    08H      3.81 (0.15)     4    315  (8 000)  GCR    CS   X3B5/85-77    1,2
  804.    09H      12.7 (0.5)     18                         C    X3B5/85-76    1,3
  805.    0AH      12.7 (0.5)     22    267  (6 667)  MFM    C                    2
  806.    0BH       6.3 (0.25)     4     63  (1 600)  PE     C    X3.56-198X      2
  807.    0CH      12.7 (0.5)     24    500 (12 690)  GCR    C                    2
  808.    0DH      12.7 (0.5)     24    999 (25 380)  GCR    C                    2
  809.  
  810. 80H _ FFH   Vendor unique
  811. All others  Reserved
  812. ==============================================================================
  813. Key:
  814.                Code                                       Type
  815. --------------------------------------------       -----------------------
  816. NRZI  Non Return to Zero, change on ones           R   Reel-to-Reel
  817. GCR   Group Code Recording                         C   Cartridge
  818. PE    Phase Encoded                                CS  Cassette
  819. IMFM  Inverted Modified Frequency Modulation
  820.  
  821. NOTES:
  822.   (1)  Working Draft.  X3B5 assigns a new document number to each revision of 
  823. their documents.  Please contact the Chairman of X3B5 for the latest document 
  824. number.
  825.   (2)  Serially Recorded.
  826.   (3)  Parallel Recorded.
  827.   (4)  Old format known as QIC-11.
  828.  
  829.  
  830.   The number of blocks field specifies the number of logical blocks on the 
  831. medium that meet the density code and block length in the block descriptor.  A 
  832.  
  833. number of blocks of zero indicates that all of the remaining logical blocks of 
  834. the logical unit shall have the medium characteristics specified by the block 
  835. descriptor.
  836.  
  837.   The block length specifies the length in bytes of each logical block 
  838. described by the block descriptor.  A block length of zero indicates that the 
  839. length shall be variable.
  840. .fo Section 9                          132.1
  841. .pa
  842.  
  843. .fo Section 9                          132.2
  844. 9.12 RESERVE UNIT and RELEASE UNIT Commands
  845.  
  846.      Peripheral Device Type:  Sequential Access
  847.         Operation Code Type:  Optional
  848.              Operation Code:  16H and 17H, respectively
  849.  
  850.                                   Table 9-15
  851.                     RESERVE UNIT and RELEASE UNIT Commands
  852.  
  853. ==============================================================================
  854.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  855. Byte |        |        |        |        |        |        |        |        |
  856. ==============================================================================
  857.  0   |                           Operation Code                              |
  858. -----|-----------------------------------------------------------------------|
  859.  1   | Logical Unit Number      | 3rdPty | Third Party Device ID    |Reserved|
  860. -----|-----------------------------------------------------------------------|
  861.  2   |                           Reserved                                    |
  862. -----|-----------------------------------------------------------------------|
  863.  3   |                           Reserved                                    |
  864. -----|-----------------------------------------------------------------------|
  865.  4   |                           Reserved                                    |
  866. -----|-----------------------------------------------------------------------|
  867.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  868. ==============================================================================
  869.  
  870.   The RESERVE UNIT and RELEASE UNIT commands both use the command descriptor 
  871. block shown in Table 9-15.
  872.  
  873.   9.12.1 RESERVE UNIT Command.  The RESERVE UNIT command (Table 9-15, 
  874. operation code 16H) shall reserve the specified logical unit for the exclusive 
  875. use by the requesting initiator or, if third-party reservation option is 
  876. implemented, to another specified SCSI device.
  877.  
  878.   The reservation shall remain in effect until superceded by another RESERVE 
  879. UNIT command from the initiator that made the reservation or until released by 
  880. a RELEASE UNIT command from the same initiator, or a BUS DEVICE RESET message 
  881. >From any initiator, or a "hard" RESET condition.  The occurrence of the last 
  882. two conditions is indicated by a sense key of UNIT ATTENTION on the next 
  883. command following the condition.  It is not an error to issue this command to 
  884. a logical unit that is currently reserved to the requesting initiator.
  885.  
  886.   If the logical unit is previously reserved by another initiator, then the 
  887. target shall either:
  888.  
  889.   (1)  return a RESERVATION CONFLICT status
  890.  
  891.   (2)  queue the reservation request and disconnect until all previously 
  892. queued reservations have been released.  When the logical unit is available, 
  893. the target shall reconnect to perform the reservation
  894.  
  895.   If, after honoring the reservation, any other initiator then subsequently 
  896. attempts to perform any command on the reserved logical unit other than a 
  897. RESERVE UNIT command, which may be queued, or a RELEASE UNIT command, which 
  898. shall be ignored, then the command shall be rejected with a RESERVATION 
  899. CONFLICT status. 
  900.  
  901. .pn 133
  902. .fo Section 9                            #
  903.  
  904.   The third-party reservation option for the RESERVE UNIT command allows an 
  905. initiator to reserve a logical unit for another SCSI device.  This option is 
  906. intended for use in multiple-initiator systems that use the COPY command.  Any 
  907. target that implements the third-party reservation option shall also implement 
  908. the third-party release option (see 9.12.2).
  909.  
  910.   If the third-party (3rdPty) bit is zero, then the third-party reservation 
  911. option is not requested.  If the 3rdPty bit is one and the third-party 
  912. reservation option is implemented, then the RESERVE UNIT command shall reserve 
  913. the specified logical unit for the SCSI device specified in the third-party 
  914. device ID field.  The target shall preserve the reservation until superceded 
  915. by another RESERVE UNIT command from the initiator that made the reservation 
  916. or until released by the same initiator, by a BUS DEVICE RESET message from 
  917. any initiator, or by a "hard" RESET condition.  The target shall ignore (i.e., 
  918. return GOOD status) any attempt made by any other initiator to release the 
  919. reservation.
  920.  
  921.   If the 3rdPty bit is one and the third-party reservation option is not 
  922. implemented, then the target shall reject the RESERVE UNIT command with a 
  923. CHECK CONDITION status and a sense key of ILLEGAL REQUEST. 
  924.  
  925.   An initiator that holds a current reservation may modify that reservation 
  926. (e.g., switch third-parties) by issuing another RESERVE UNIT command to the 
  927. same logical unit.  The superceding RESERVE UNIT command shall release the 
  928. previous reservation state only when the new reservation is granted.  A 
  929. superceding reservation takes priority over any previously queued reservation 
  930. request.
  931.  
  932.   9.12.2 RELEASE UNIT Command.  The RELEASE UNIT command (Table 9-15, 
  933. operation code 17H) shall release the logical unit if it is currently reserved 
  934. by the requesting initiator. 
  935.  
  936.   It is not an error to attempt to release a logical unit that is not 
  937. currently reserved to the requesting initiator.  However, it shall not be 
  938. released if it is reserved by another initiator.
  939.  
  940.   The third-party release option for the RELEASE UNIT command allows an 
  941. initiator to release a logical unit that was previously reserved using the 
  942. third-party reservation option (see 9.12.1).  This option shall be implemented 
  943. if the third-party reservation option is implemented.  This option is intended 
  944. for use in multiple-initiator systems that use the COPY command.
  945.  
  946.   If the third-party (3rdPty) bit is zero, then the third-party release option 
  947. is not requested.  If the 3rdPty bit is one and the target implements the 
  948. third-party release option, then the target shall release the specified 
  949. logical unit, but only if the reservation was made using the third-party 
  950. reservation option by the initiator that is requesting the release and for the 
  951. same SCSI device as specified in the third-party device ID field.
  952.  
  953.   If the 3rdPty bit is one and the target does not implement the third-party 
  954. release option, then the target shall terminate the command with a CHECK 
  955. CONDITION status and the sense key shall be set to ILLEGAL REQUEST.
  956. .pa
  957.  
  958. 9.13 ERASE Command
  959.  
  960.      Peripheral Device Type:  Sequential Access
  961.         Operation Code Type:  Optional
  962.              Operation Code:  19H
  963.  
  964.                                   Table 9-16
  965.                                 ERASE Command
  966.  
  967. ==============================================================================
  968.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  969. Byte |        |        |        |        |        |        |        |        |
  970. ==============================================================================
  971.  0   |                           Operation Code                              |
  972. -----|-----------------------------------------------------------------------|
  973.  1   | Logical Unit Number      |                  Reserved         | Long   |
  974. -----|-----------------------------------------------------------------------|
  975.  2   |                           Reserved                                    |
  976. -----|-----------------------------------------------------------------------|
  977.  3   |                           Reserved                                    |
  978. -----|-----------------------------------------------------------------------|
  979.  4   |                           Reserved                                    |
  980. -----|-----------------------------------------------------------------------|
  981.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  982. ==============================================================================
  983.  
  984.   The ERASE command (Table 9-16) causes part or all of the remaining medium to 
  985. be erased beginning from the current medium position.  As used here, "erased" 
  986. means either the medium shall be erased or a pattern shall be written on the 
  987. medium that appears as gap to the target.
  988.  
  989.   The distance to be erased is controlled by the long bit.  A long bit of one 
  990. indicates that all remaining medium on the logical unit shall be erased.  A 
  991. long bit of zero indicates that a peripheral device specified portion of the 
  992. medium shall be erased.  Normally, short erases are used to create an extended 
  993. gap for software controlled error recovery or for support of "update in place" 
  994. functions.  The medium position following an ERASE command with a long bit of 
  995. one is not defined by this standard.
  996.  
  997. NOTE:  Some targets may reject ERASE commands with the long bit set to one if 
  998. the medium is not positioned at the beginning-of-medium.
  999. .pa
  1000.  
  1001. 9.14 MODE SENSE Command
  1002.  
  1003.      Peripheral Device Type:  Sequential Access
  1004.         Operation Code Type:  Optional
  1005.              Operation Code:  1AH
  1006.  
  1007.                                   Table 9-17
  1008.                               MODE SENSE Command
  1009.  
  1010. ==============================================================================
  1011.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1012. Byte |        |        |        |        |        |        |        |        |
  1013. ==============================================================================
  1014.  0   |                           Operation Code                              |
  1015. -----|-----------------------------------------------------------------------|
  1016.  1   | Logical Unit Number      |                  Reserved                  |
  1017. -----|-----------------------------------------------------------------------|
  1018.  2   |                           Reserved                                    |
  1019. -----|-----------------------------------------------------------------------|
  1020.  3   |                           Reserved                                    |
  1021. -----|-----------------------------------------------------------------------|
  1022.  4   |                           Allocation Length                           |
  1023. -----|-----------------------------------------------------------------------|
  1024.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1025. ==============================================================================
  1026.  
  1027.   The MODE SENSE command (Table 9-17) provides a means for a target to report 
  1028. its medium, logical unit, or peripheral device parameters to the initiator.  
  1029. It is a complementary command to the MODE SELECT command (see 9.11) for 
  1030. support of a medium that may contain different densities, such as half-inch 
  1031. tapes.
  1032.  
  1033.   The allocation length specifies the number of bytes that the initiator has 
  1034. allocated for returned MODE SENSE data.  An allocation length of zero 
  1035. indicates that no MODE SENSE data shall be transferred.  This condition shall 
  1036. not be considered as an error.  Any other value indicates the maximum number 
  1037. of bytes that shall be transferred.  The target shall terminate the DATA IN 
  1038. phase when allocation length bytes have been transferred or when all available 
  1039. MODE SENSE data have been transferred to the initiator, whichever is less.
  1040.  
  1041.   The MODE SENSE data (Table 9-18) contains a four-byte header, followed by 
  1042. zero or more eight-byte block descriptors, followed by the vendor unique 
  1043. parameters, if any.
  1044. .pa
  1045.  
  1046.                                   Table 9-18
  1047.                                MODE SENSE Data
  1048.  
  1049. ==============================================================================
  1050.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1051. Byte |        |        |        |        |        |        |        |        |
  1052. ==============================================================================
  1053.  0   |                           Sense Data Length                           |
  1054. -----|-----------------------------------------------------------------------|
  1055.  1   |                           Medium Type                                 |
  1056. -----|-----------------------------------------------------------------------|
  1057.  2   |   WP   |   Buffered Mode          |         Speed                     |
  1058. -----|-----------------------------------------------------------------------|
  1059.  3   |                           Block Descriptor Length                     |
  1060. ==============================================================================
  1061.      |                        Block Descriptor(s)                            |
  1062. ==============================================================================
  1063.  0   |                           Density Code                                |
  1064. -----|-----------------------------------------------------------------------|
  1065.  1   |                           Number of Blocks (MSB)                      |
  1066. -----|-----------------------------------------------------------------------|
  1067.  2   |                           Number of Blocks                            |
  1068. -----|-----------------------------------------------------------------------|
  1069.  3   |                           Number of Blocks (LSB)                      |
  1070. -----|-----------------------------------------------------------------------|
  1071.  4   |                           Reserved                                    |
  1072. -----|-----------------------------------------------------------------------|
  1073.  5   |                           Block Length (MSB)                          |
  1074. -----|-----------------------------------------------------------------------|
  1075.  6   |                           Block Length                                |
  1076. -----|-----------------------------------------------------------------------|
  1077.  7   |                           Block Length (LSB)                          |
  1078. ==============================================================================
  1079.      |                        Vendor Unique Parameter(s)                     |
  1080. ==============================================================================
  1081. 0 _ n|                           Vendor Unique                               |
  1082.      |                           Parameter Byte(s)                           |
  1083. ==============================================================================
  1084.  
  1085.   The sense data length specifies the length in bytes of the following mode 
  1086. sense data that is available to be transferred during the DATA IN phase.  The 
  1087. sense data length does not include itself.
  1088.  
  1089.   Code values for the medium type field shall be assigned as follows:
  1090.  
  1091.    00H        Default (Only one medium type supported)
  1092.    01H _ 7FH  Reserved
  1093.    80H _ FFH  Vendor unique
  1094.  
  1095.   A write protected (WP) bit of zero indicates that the medium is write 
  1096. enabled.  A write protected bit of one indicates that the medium is write 
  1097. protected.
  1098.  
  1099.   A buffered mode of zero indicates that the target does not report a GOOD 
  1100. status on WRITE commands until the data blocks are actually written on the 
  1101. medium.  A buffered mode of one indicates that the target may report a GOOD 
  1102.  
  1103. status on WRITE commands as soon as the data block has been transferred to the 
  1104. SCSI device buffer.  One or more blocks may be buffered prior to writing the 
  1105. block(s) to the medium.  Buffered modes of 2H through 7H are reserved.
  1106.  
  1107.   Code values for the speed field shall be assigned as follows:
  1108.  
  1109.    0H         Default (only one speed supported)
  1110.    1H         Lowest peripheral device speed
  1111.    2H _ FH    Increasing peripheral device speeds
  1112.  
  1113.   The block descriptor length specifies the length in bytes of all the block 
  1114. descriptors.  It is equal to the number of block descriptors times eight and 
  1115. does not include the vendor unique parameters, if any.  A block descriptor 
  1116. length of zero indicates that no block descriptors shall be included in the 
  1117. parameter list.  This condition shall not be considered as an error.
  1118.  
  1119.   Each block descriptor specifies the medium characteristics for all or part 
  1120. of a logical unit.  Each block descriptor contains a density code, a number of 
  1121. blocks, and a block length.
  1122.  
  1123.   Code values for the density code field are defined in Table 9-14.1.
  1124.  
  1125.   The number of blocks field specifies the number of logical blocks on the 
  1126. medium that meet the density code and block length in the block descriptor.  A 
  1127. number of blocks of zero indicates that all of the remaining logical blocks of 
  1128. the logical unit have the medium characteristics specified by the block 
  1129. descriptor.
  1130.  
  1131.   The block length specifies the length in bytes of each logical block 
  1132. described by the block descriptor.  A block length of zero indicates that the 
  1133. length is variable.
  1134. .pa
  1135.  
  1136. 9.15 LOAD/UNLOAD Command
  1137.  
  1138.      Peripheral Device Type:  Sequential Access
  1139.         Operation Code Type:  Optional
  1140.              Operation Code:  1BH
  1141.  
  1142.                                   Table 9-19
  1143.                              LOAD/UNLOAD Command 
  1144.  
  1145. ==============================================================================
  1146.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1147. Byte |        |        |        |        |        |        |        |        |
  1148. ==============================================================================
  1149.  0   |                           Operation Code                              |
  1150. -----|-----------------------------------------------------------------------|
  1151.  1   | Logical Unit Number      |                  Reserved         | Immed  |
  1152. -----|-----------------------------------------------------------------------|
  1153.  2   |                           Reserved                                    |
  1154. -----|-----------------------------------------------------------------------|
  1155.  3   |                           Reserved                                    |
  1156. -----|-----------------------------------------------------------------------|
  1157.  4   |                           Reserved                  | Re-Ten |  Load  |
  1158. -----|-----------------------------------------------------------------------|
  1159.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1160. ==============================================================================
  1161.  
  1162.   The LOAD/UNLOAD command (Table 9-19) requests that the target enable or 
  1163. disable the logical unit for further operations.  This command may also be 
  1164. used to request the re-tension function on peripheral devices that support 
  1165. this function.
  1166.  
  1167.   A load bit of one indicates that the medium on the logical unit shall be 
  1168. loaded and positioned to the beginning-of-medium or load-point as determined 
  1169. by the peripheral device.  A load bit of zero indicates that the medium on the 
  1170. logical unit shall be positioned for removal from the peripheral device.
  1171.  
  1172.   Status shall be returned after the medium is positioned unless the immediate 
  1173. (Immed) bit is one.  If the Immed bit is one, status may be returned as soon 
  1174. as the command has been accepted.
  1175.  
  1176.   A re-tension (Re-Ten) bit of one indicates that the medium on the addressed 
  1177. logical unit shall be correctly tensioned before the LOAD/UNLOAD command is 
  1178. completed.  This is an optional function intended for use by those peripheral 
  1179. devices that support the re-tension function.
  1180. .pa
  1181.  
  1182. 9.16 PREVENT/ALLOW MEDIUM REMOVAL Command
  1183.  
  1184.      Peripheral Device Type:  Sequential Access
  1185.         Operation Code Type:  Optional
  1186.              Operation Code:  1EH
  1187.  
  1188.                                   Table 9-20
  1189.                      PREVENT/ALLOW MEDIUM REMOVAL Command
  1190.  
  1191. ==============================================================================
  1192.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1193. Byte |        |        |        |        |        |        |        |        |
  1194. ==============================================================================
  1195.  0   |                           Operation Code                              | 
  1196. -----|-----------------------------------------------------------------------|
  1197.  1   | Logical Unit Number      |                  Reserved                  |
  1198. -----|-----------------------------------------------------------------------|
  1199.  2   |                           Reserved                                    |
  1200. -----|-----------------------------------------------------------------------|
  1201.  3   |                           Reserved                                    |
  1202. -----|-----------------------------------------------------------------------|
  1203.  4   |                           Reserved                           | Prevent|
  1204. -----|-----------------------------------------------------------------------|
  1205.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1206. ==============================================================================
  1207.  
  1208.   The PREVENT/ALLOW MEDIUM REMOVAL command (Table 9-20) requests that the 
  1209. target enable or disable the removal of the medium in the logical unit.
  1210.  
  1211.   A prevent bit of one shall inhibit mechanisms that normally allow removal of 
  1212. the medium.  A prevent bit of zero shall allow removal of the medium.
  1213.  
  1214.   This prevention of medium removal condition shall terminate upon receipt of 
  1215. a PREVENT/ALLOW MEDIUM REMOVAL command with the prevent bit set to zero, or by 
  1216. the receipt of a BUS DEVICE RESET message from any initiator or by a "hard" 
  1217. RESET condition.
  1218. .pa
  1219.  
  1220. 
  1221.  
  1222.